package de.szut.events;

import java.util.Collection;
import java.util.EventObject;
import java.util.concurrent.ConcurrentHashMap;

/**
 * Implementation of ConcurrentHashMap to hold events.
 * Events are <b>not</b> fired in order!
 * @author Marc Huisinga
 *
 * @param <K> - Key of the event
 * @param <T> - Type of the event
 */
public class EventConcurrentHashMap<K,T extends Event> extends ConcurrentHashMap<K,T> implements FireableCollection {

	private static final long serialVersionUID = -5185438627955527728L;

	@Override
	public void fireAll(EventObject e) {
		new EventCannoneer<Collection<T>>(this.values()).fire(e);
	}

}
